#ifndef STREAMBASE_H
#define STREAMBASE_H

#include <QObject>
#include "EZTally/EZTallyObject.h"

class StreamBase : public QObject , public EZTally::EZTallyObject
{
    Q_OBJECT
public:
    explicit StreamBase();

    typedef enum StreamBaseState_{
        StreamBase_Error = -1,
        StreamBase_goingon = 0,
        StreamBase_end = 1
    }StreamBaseState;

public:
    virtual qint64 size(){return _size;}
    virtual StreamBaseState isEof(){return _isEof;}
    virtual qint64 validFrom(qint64 offset=0) = 0;
    virtual qint64 read(void *buffer,qint64 offset,qint64 bufferLen) = 0;

protected:
    virtual ~StreamBase();

    qint64 _size;
    StreamBaseState _isEof;
signals:
    void availableChange(qint64 offset,qint64 dataLen);
public slots:

};

#endif // STREAMBASE_H
